﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Data;

namespace BlogPlat.Model
{
    [MetadataType(typeof(PostMetadata))]
    public partial class Post
    {

    }

    [Bind(Exclude = "ID")]
    public class PostMetadata
    {
        [HiddenInput(DisplayValue = false)]
        public int ID { get; set; }

        [DisplayName("Author")]
        [HiddenInput(DisplayValue = false)]
        public string Author { get; set; }

        [Required(ErrorMessage = "Please enter blog title")]
        [StringLength(250)]
        [DisplayName("Title")]
        public string PostTitle { get; set; }

        [StringLength(500)]
        [DisplayName("Summary")]
        [Required(ErrorMessage = "Please enter some summary of this post")]
        public string PostSummary { get; set; }

        [Required(ErrorMessage = "Please enter blog content")]
        [DisplayName("Content")]
        public string PostContent { get; set; }

        [Required(ErrorMessage = "Please enter publish date")]
        [DisplayName("Publish Date")]
        [DataType(DataType.DateTime)]
        public DateTime DatePublished { get; set; }

        [DisplayName("Draft")]
        public bool IsDraft { get; set; }

        public int ViewCount { get; set; }

        [Required(ErrorMessage = "Please enter friendly Url for this blog post")]
        [DisplayName("Friendly Url")]
        public string FriendlyUrl { get; set; }

        [DisplayName("Enable Comments For This Post")]
        public bool EnableComments { get; set; }

        [DisplayName("Select category for this post")]
        public int CategoryID { get; set; }
    }
}
